import commonService from 'service/common'
export default {
  //新增标签
  async child_addTag(data) {
    let dataObj = Object.assign({
        'name':''
    }, data)

    let paramsJson = {
      method: 'post',
      url: '/issue/tag',
      data: dataObj,
      headers:{

      }
    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
  //获取所有标签
  async getAddTag(data) {
    let dataObj = Object.assign({

    }, data)
    let paramsJson = {
      method: 'get',
      url: '/issue/tag',
      data: dataObj,

    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
  //删除标签
  async delAddTag(id) {
    let paramsJson = {
      method: 'DELETE',
      url: '/issue/tag/'+id,
    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
  //修改标签
  async corAddTag(data) {
    let dataObj = Object.assign({
      'id':'',
      'name':'',
    }, data)
    let paramsJson = {
      method: 'PUT',
      url: '/issue/tag',
      data: dataObj,

    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
//....................................................................................................
  //搜所方法
  async searchChild(data) {
    let dataObj = Object.assign({
      'stuId':'',
    }, data)
    let paramsJson = {
      method: 'get',
      url: '/issue/tag/studentTag',
      params: dataObj,

    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
  //获取标签下的学生
  async TagChild(data) {
    let dataObj = Object.assign({
      'tagId':'',
    }, data)
    let paramsJson = {
      method: 'get',
      url: '/issue/tag/tagStudent',
      params: dataObj,

    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
  //修改学生标签
  async ChangeStudentTag(data) {
    let dataObj = Object.assign({
      "stuId": "",
      "tagIds": []
    }, data)
    let paramsJson = {
      method: 'post',
      url: '/issue/tag/studentTag',
      data: dataObj,

    }
    let jsondata = await commonService.asyncFetchData(paramsJson)
    return jsondata
  },
}
